Update pedestrian consideration to factor in distance from ego vehicle #1585
+26
−14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstract
This pull request enhances pedestrian obstacle detection by adding a maximum detection range, so that only pedestrians within a specified distance from the ego vehicle are considered when evaluating lane obstacles.
Background
The previous implementation only checked whether a pedestrian occupied a lane and was ahead, causing the vehicle to react even to distant pedestrians. This could lead to unnecessary stops or unnatural behavior. Introducing a distance threshold ensures more realistic and efficient obstacle detection.
Details
Extended the signature of the
hasObstacleInPedestrianLanes
lambda to accept a new parameter,max_detect_length
(maximum detection distance).Calculated the Euclidean distance between the ego vehicle and each pedestrian; only if
norm < max_detect_length
are the pedestrian’s lane IDs collected.Updated the call within
FollowLaneAction::detectObstacleInLane
from:hasObstacleInPedestrianLanes(pedestrian_lanes)
to:
where 10.0 m is the default detection range.
Before
before.mov
After
after.mov
References
Destructive Changes
N/A
Known Limitations
N/A